import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../pages/Index";
import Brand from "../pages/goods/Brand";
import Category from "../pages/goods/Category";
import Goods from "../pages/goods/Goods";
import Specification from "../pages/goods/Specification";
import Login from "../pages/Login";

Vue.use(VueRouter)

const routes = [
    {
        path:'/',
        name: "Login",
        component: Login
    },
    {
        path: '/index',
        name: 'Index',
        component: Index,
        children: [ //配置子路由
            {
                path: '/brand',
                name: 'Brand',
                component: Brand
            },
            {
                path: '/category',
                name: 'Category',
                component: Category
            },
            {
                path: '/list',
                name: 'Goods',
                component: Goods
            },
            {
                path: '/specification',
                name: 'Specification',
                component: Specification
            }
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
